project(USER_STARTER_TST)

set(ARKTSCONFIG_PATH "${CMAKE_CURRENT_BINARY_DIR}/arktsconfig.json")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/arktsconfig.json.in" "${ARKTSCONFIG_PATH}")

compile_panda_source(
    TARGET_NAME user_starter_tst_src
    SRC_FILE_NAME "UserRunTst.ets"
    ARKTSCONFIG ${ARKTSCONFIG_PATH}
)

ark_link(TARGET_NAME user_starter_tst_link
    ABC_FILE_LIST
        ${USER_STARTER_TST_BINARY_DIR}/UserRunTst.abc
        ${MEASURE_NATIVE_LIB_BINARY_DIR}/MeasureNativeLib.abc
        ${TST_LIB_BINARY_DIR}/TstLib.abc
    OUTPUT_FILE
        ${CMAKE_CURRENT_BINARY_DIR}/UserAbcTotal.abc
    EXTRA_DEPS
        user_starter_tst_src
        tst_lib_srcs
)

run_user_app(
    TARGET_NAME user_starter_tst_run
    EXTRA_DEPS user_starter_tst_link
    CLASSNAME UserRunTst.UserRunTst
    USER_ABC_PATH ${USER_STARTER_TST_BINARY_DIR}/UserAbcTotal.abc
    EXTRA_LAUNCHER_OPTS
        "--PandaOpt=--ext:--native-library-path=${MEASURE_NATIVE_LIB_BINARY_DIR}:${TST_LIB_BINARY_DIR}"
        #"--PandaOpt=--ext:--enable-an"
        #"--PandaOpt=--ext:--log-components=AOT"
        #"--PandaOpt=--ext:--log-level=debug"
)

